﻿//AcademicPlanner - course registration planning web app.
//Copyright (C) 2009  Boubacar Diallo

//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AcademicPlanner.Domain.Models;
using AcademicPlanner.Framework.Helpers;

namespace AcademicPlanner.Presentation.Views.Shared
{
	/// <summary>
	/// AcademicPlanControlModel represents a model
	/// object for a <c>AcademicPlanControl</c> control.
	/// </summary>
	/// <since>1.0</since>
	public class AcademicPlanControlModel : ControlModel
	{
		/// <summary>
		/// Gets or sets the <c>AcademicPlan</c> whose information
		/// is to be displayed.
		/// </summary>
		public AcademicPlan AcademicPlan { get; set; }
	}


	/// <summary>
	/// AcademicPlanControl represents a control for displaying
	/// information about a <c>AcademicPlan</c>.
	/// </summary>
	/// <since>1.0</since>
	public partial class AcademicPlanControl : Control<AcademicPlanControlModel>
	{
		/// <summary>
		/// Gets or sets the options on this control's side menu.
		/// </summary>
		/// <remarks>
		/// The options are used in a html select tag: 0 => Edit.
		/// </remarks>
		/// <since>1.0</since>
		public IDictionary<string, string> ActionsSideMenuOptions { get; set; }


		/// <summary>
		/// Handles the page load event for this control by initializing its
		/// properties.
		/// </summary>
		/// <param name="sender">The sender of the event.</param>
		/// <param name="e">The details of the event.</param>
		/// <since>1.0</since>
		protected void Page_Load(object sender, EventArgs e)
		{
			Title = Tr("Plan Settings");
			if (string.IsNullOrEmpty(Model.Id))
				Model.Id = "academicPlanControl";

			ActionsSideMenuOptions = new Dictionary<string, string>();
			ActionsSideMenuOptions["0"] = Tr("Edit");
		}
	}
}